<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
<ui:composition template="../template/layout.xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets">
	<ui:param name="pageHeaderTitle" value="View client profile" />
	<ui:define name="content">
		<br /><br />
		<h2 style="text-align: center">#{viewClientProfileBean.client.firstName} #{viewClientProfileBean.client.lastName}</h2>
		<h3 style="text-align: center">profile details</h3>
		<div id="inner_content">
		<h:panelGrid columns="2" cellpadding="4" styleClass="viewClientGrid" columnClasses="viewClientGridColumn1, viewClientGridColumn2">

				<h:panelGroup>
					<p:outputLabel value="Date of birth: " style="font-weight:bold"/>
				</h:panelGroup>
				
				<h:panelGroup>
					<h:outputText value="#{viewClientProfileBean.client.birthDate}" converter="stringToCalendarConverterNoTime" />
				</h:panelGroup>

				<h:panelGroup>					
					<p:outputLabel value="Telephone: "  style="font-weight:bold"/>
				</h:panelGroup>
				
				<h:panelGroup>
					<h:outputText value="#{viewClientProfileBean.client.phone}" />
				</h:panelGroup>

				<h:panelGroup>					
					<p:outputLabel value="Information: "  style="font-weight:bold"/>
				</h:panelGroup>
				
				<h:panelGroup>
					<h:outputText value="#{viewClientProfileBean.client.info}" styleClass="infoText" />
				</h:panelGroup>

				<h:panelGroup>					
					<p:outputLabel value="Discount category: "  style="font-weight:bold"/>
				</h:panelGroup>
				
				<h:panelGroup>
					<h:outputText value="#{viewClientProfileBean.client.cat}"/>
				</h:panelGroup>								
				
				<h:panelGroup>
					<br />
					<h:outputLink value="viewTreatmentHistory.xhtml?clientId=#{viewClientProfileBean.client.id}">Treatment history</h:outputLink>
				</h:panelGroup>
				
				<h:panelGroup>
				</h:panelGroup>
				
				<h:panelGroup rendered="#{request.isUserInRole('Receptionist')}">	
				<h:form>
				
						<p:commandButton value="Delete"
							onclick="confirmation.show();return false;" style="margin-left: 0px; margin-top: 12px" styleClass="pDeleteButton" />
	
						<p:confirmDialog message="Are you sure want to delete client profile?"
							widgetVar="confirmation">
							<p:commandButton value="Yes" onclick="confirmation.hide()"
								actionListener="#{viewClientProfileBean.deleteProfile}">
							</p:commandButton>
							<p:commandButton value="No" onclick="confirmation.hide()"
								type="button" />
						</p:confirmDialog>
						
					</h:form>									
				</h:panelGroup>										

			</h:panelGrid>
			<br />			
			<br /> <br />			
		</div>
	</ui:define>
</ui:composition>
</html>